package com.project.easyt.common.db.common.core.spring;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @author GreatorMan.cool
 * @copyright: Copyright (c) 2020
 * @company: 扬起科技有限公司
 * @date 2021/9/7 21:26
 * @description: 数据库读写分离封装
 */
public class DynamicDataSource extends AbstractRoutingDataSource {
    /**
     * @return 获取数据源Key
     */
    @Override
    protected Object determineCurrentLookupKey() {
        return DynamicContextHolder.getDbType();
    }
}
